﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="FormlyPage1.aspx.cs" Inherits="Dashboard.TestFormly.FormlyPage1" %>



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <asp:PlaceHolder ID="PlaceHolder1" runat="server">
        <%: System.Web.Optimization.Styles.Render("~/bundles/Formly/css") %>
        <%: System.Web.Optimization.Scripts.Render("~/bundles/Formly") %>
    </asp:PlaceHolder>
    <!-- Common -->
    <script type="text/javascript" lang="javascript" src="../Scripts/Formly/FormlyHelper.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.Core.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.Directives.DateTimePicker.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.Directives.FileUpload.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.js"></script>
    <!-- Common -->

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!-- 
        Sitemap Menu item:
        <siteMapNode url="~/FormlyPage1.aspx" title="FormlyPage1" description="FormlyPage1" image="fa-warning" id="FormlyPage1"/>
    -->
    <section class="panel">
	        <header class="panel-heading">
				<h2>Test Formly</h2>
			</header>
            <div class="panel-tools" align="right">
				<ul class="tooltip-area">
					<li><a href="javascript:Collapse(0)" class="btn btn-collapse" title="Collapse"><i class="fa fa-sort-amount-asc"></i></a></li>
					<li><a href="javascript:Reload(0)" class="btn btn-reload"  title="Reload"><i class="fa fa-retweet"></i></a></li>
					<li><a href="javascript:Close(0)" class="btn btn-close" title="Close"><i class="fa fa-times"></i></a></li>
				</ul>
			</div>



            <div class="panel-body">
				<!-- PUT YOUR CONTENT HERE -->
				<div ng-app="formlyExample" ng-controller="MainCtrl as vm" name="divContainer" id="divContainer">
					<div ng-if="vm.loadingData.$$state.status === 0" style="margin:20px 0;font-size:2em">
						<strong>Loading...</strong>
					</div>
					<div ng-if="vm.loadingData.$$status.state !== 0">
						<form ng-submit="vm.onSubmit()" novalidate id="formlyForm">
							<formly-form model="vm.model" fields="vm.fields" form="vm.form">
								<button type="sumbit" class="btn btn-primary submit-button" ng-disabled="vm.form.$invalid">Submit</button>
							</formly-form>
						</form>
					</div>
				</div>

			</div>


			
            <footer class="panel-footer" align="right">
				<button type="invia" class="btn" data-color="#F4AD41">Invia</button>
				<button type="reset" class="btn">Cancel</button>
			</footer>

	</section>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LocaJavascript" runat="server">
  <% HttpContext.Current.Response.Write("xxx"); %>

  <script>
      var settings = new FormlySettings();
      settings.container = '#divContainer';
      //settings.shortcutCallback = DoSubmit;
      settings.setLoad(settings.createGetConfig('/api/Employee/LoadFields'));
      //settings.setSend(settings.createPostConfig('/api/Employee/Upload'));

      FormlyManager(settings);


      
  </script>

</asp:Content>